<?php
if(isset($_POST['ok'])){
	$val=new Helper_Validation;
	$val->check_empty($_POST['txtbc'],ERROR_BANGCAP_EMPTY);
	if($val->valid() == FALSE){
		$data[error]=$val->_mess;
	}else{
		$mbangcap=new Model_Bangcap;
		$data=array(
				"ten_bc" => $_POST['txtbc']
		);
		if($mbangcap->insert_bangcap($data)==TRUE){
			redirect("index.php?module=bangcap&act=list");
		}else{
			$data['error'][]=ERROR_BANGCAP_CREATE;
		}
	}
}
$data['title']="Thêm bằng cấp";
loadview("bangcap/add_view",$data);
